package com.similarworld.dao;

import java.util.List;

import javax.persistence.Query;

import org.springframework.stereotype.Component;

import com.similarworld.model.Item;
import com.similarworld.type.ItemStatus;

@Component
public class ItemDao extends AbstractDAO<Item> {

	public List<Item> getItems(ItemStatus status, Integer count) {
		String sql = "from Item cate where cate.status =:status";
		Query query = entityManager.createQuery(sql);
		query.setParameter("status", status);
		query.setMaxResults(count);
		return query.getResultList();
	}
	
}
